package org.buptsse.entity;

import java.util.ArrayList;

import android.graphics.Canvas;
import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;

public class MyItemizedOverlay extends ItemizedOverlay {

	
	ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
	Drawable drawable;
	
	public MyItemizedOverlay(Drawable defaultMarker) {
		super(defaultMarker);
		// TODO Auto-generated constructor stub
		this.drawable=defaultMarker;
	}

	@Override
	protected OverlayItem createItem(int i) {
		// TODO Auto-generated method stub
		return items.get(i);
	}

	@Override
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		// TODO Auto-generated method stub
		super.draw(canvas, mapView, shadow);
		//显示图标，图标位置在目标点下面，居中的位置
        boundCenterBottom(drawable);
	}

	@Override
	public int size() {
		// TODO Auto-generated method stub
		return items.size();
	}

}
